<%@ page language="java"
         import="com.ruohi.manage.DBType,com.ruohi.manage.PoolManager,com.ruohi.util.common.*,com.ruohi.util.dbutil.DBHelper,java.sql.Connection"
         pageEncoding="UTF-8" %>
<%@ page import="java.util.*" %>
<%
	Connection connection = null;
	String tablePrefix = Env.getInstance().getProperty("table_prefix");
	DBHelper dbHelper = DBHelper.getInstance();
	Map model = new HashMap();
	String tableName = " gift_member ";
	try{
		Map typeMap = new LinkedHashMap();
		typeMap.put("","-请选择类型-");
		typeMap.putAll(CommonApplication.getEnumChildren("115",application));
		Map isMap = new HashMap();
		isMap.put("1","正常");
		isMap.put("0","禁用");
		
		connection = PoolManager.getConnection(DBType.getDBTypeByEnum("106013"));
		String mem_no = CommonString.getFormatPara(request.getParameter("mem_no"));
		String channelUUID = CommonString.getFormatPara(request.getParameter("channel_uuid"));
		if(null!=mem_no&&!"".equals(mem_no)){
			model = dbHelper.getMap(" select * from "+tableName+" where mem_no = ? ",new Object [] {mem_no} , connection);
		}
		if("".equals(channelUUID)&&null!=model){
			channelUUID = (String)model.get("channel_uuid");
		}
		List<Map> brandList = (ArrayList)application.getAttribute("giftBrandList");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><%=Env.getInstance().getProperty("project_name") %></title>
<link href="/plugin/ui/ligerUI/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<link href="/plugin/ui/ligerUI/ligerUI/skins/Gray/css/all.css" rel="stylesheet" type="text/css" />
<link href="/plugin/ui/ligerUI/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
<link href="/backend/style/style.css" rel="stylesheet" type="text/css" />
<script src="/plugin/jquery/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8" src="/plugin/editor/ueditor/editor_config.js"></script>
<script type="text/javascript" charset="utf-8" src="/plugin/editor/ueditor/editor_all_min.js"></script>
<script type="text/javascript" src="/plugin/area/city/citys.js"></script>
<link rel="stylesheet" type="text/css" href="/plugin/editor/ueditor/themes/default/ueditor.css"/>
<style type="text/css">
	.formRight { width:250px; text-align:left; }
</style>
</head>

<body style="margin: 0;padding: 0; overflow-x: hidden; overflow-y: auto; ">
<form name="theform" id="theform" action="/backend/action/crud.jsp?enumNo=106013">
  <div class="formDiv">
  	<div class="group">
		<span><img src="/plugin/ui/ligerUI/ligerUI/skins/icons/communication.gif" /></span>
		<span class="groupTitle">账号信息（<font color="#ff0000">*</font>为必填项）</span>
	</div>
    <div class="formLeft"><span style="color:#F00">* </span>用<span class="span3"></span>户<span class="span3"></span>名</div>
    <div class="formRight">
      <input type="text" dataType='Require' msg='用户名不能为空！' style="width:120px;" class="jr_text" name="zd_mem_no" id="zd_mem_no" value="<%=CommonString.getFormatPara(model.get("mem_no")) %>" readonly="readonly"/>
    </div>
    <div style="clear:left;"></div>
    <div class="formLeft"><span style="color:#F00">* </span>会员类型</div>
    <div class="formRight">
      <select class="select" id="zd_type" name="zd_type" dataType='Require' msg='请选择会员类型！'>
      	<%=CommonForm.createSelect(typeMap,CommonString.getFormatPara(model.get("type"))) %>
      </select>
    </div>
    <div class="formLeft">品牌</div>
    <div class="formRight" style="width:190px">
      <select class="jr_select" id="zd_brand" name="zd_brand">
      	<option value="">-请选择品牌-</option>
        <%if(brandList != null){for(Map m : brandList){%>
        <option value="<%=m.get("no")%>" <%if(CommonString.getFormatPara(model.get("brand")).equals(m.get("no").toString())){%> selected="selected"<%}%>><%=CnToFullSpell.getFirstSpell(CommonString.getFormatPara(m.get("name"))).length()>=1?CnToFullSpell.getFirstSpell(CommonString.getFormatPara(m.get("name"))).substring(0,1):""%>-<%=CommonString.getFormatPara(m.get("name"))%></option>
        <%}}%>
      </select>
    </div>
    <div style="clear:left;"></div>
    <div class="group">
		<span><img src="/plugin/ui/ligerUI/ligerUI/skins/icons/communication.gif" /></span>
		<span class="groupTitle">用户资料（<font color="#ff0000">*</font>为必填项）</span>
	</div>
    <div class="formLeft">真实姓名</div>
    <div class="formRight">
      <input type="text" class="jr_text" name="zd_mem_name" id="zd_mem_name" value="<%=CommonString.getFormatPara(model.get("mem_name")) %>" />
    </div>
    <div class="formLeft">性<span class="span2"></span>别</div>
    <div class="formRight">
      <%=CommonForm.createSexRadio(CommonString.getFormatPara(model.get("sex")),"zd_sex") %>
    </div>
    <div style="clear:left;"></div>
    <div class="formLeft">座<span class="span2"></span>机</div>
    <div class="formRight">
      <input type="text" class="jr_text" name="zd_tel" id="zd_tel" value="<%=CommonString.getFormatPara(model.get("tel")) %>" />
    </div>
    <div class="formLeft">手<span class="span2"></span>机</div>
    <div class="formRight">
      <input type="text" class="jr_text" name="zd_mobile" id="zd_mobile" value="<%=CommonString.getFormatPara(model.get("mobile")) %>" />
    </div>
    <div style="clear:left;"></div>
    <div class="formLeft">传<span class="span2"></span>真</div>
    <div class="formRight">
      <input type="text" class="jr_text" name="zd_fax" id="zd_fax" value="<%=CommonString.getFormatPara(model.get("fax")) %>" />
    </div>
    <div class="formLeft">Q<span class="span2"></span>Q</div>
    <div class="formRight">
      <input type="text" class="jr_text" name="zd_qq" id="zd_qq" value="<%=CommonString.getFormatPara(model.get("q")) %>" />
    </div>
    <div style="clear:left;"></div>
    <div class="formLeft">邮<span class="span2"></span>箱</div>
    <div class="formRight">
      <input type="text" class="jr_text" name="zd_email" id="zd_email" value="<%=CommonString.getFormatPara(model.get("email")) %>" />
    </div>
    <div class="formLeft">公<span class="span2"></span>司</div>
    <div class="formRight">
      <input type="text" class="jr_text" name="zd_company" id="zd_company" value="<%=CommonString.getFormatPara(model.get("company")) %>" />
    </div>
    <div style="clear:left;"></div>
    <div class="formLeft">所<span class="span3"></span>在<span class="span3"></span>地</div>
    <div class="formRight">
      <select name="zd_province" id="zd_province" onchange="set_city(this,this.value,theform.zd_city,'');" style="width: 80px;" >
	       <option value="">选择省</option>
	       <option value="安徽">安徽</option>
	       <option value="北京">北京</option>
	       <option value="重庆">重庆</option>
	       <option value="福建">福建</option>
	       <option value="甘肃">甘肃</option>
	       <option value="广东">广东</option>
	       <option value="广西">广西</option>
	       <option value="贵州">贵州</option>
	       <option value="海南">海南</option>
	       <option value="河北">河北</option>
	       <option value="黑龙江">黑龙江</option>
	       <option value="河南">河南</option>
	       <option value="湖北">湖北</option>
	       <option value="湖南">湖南</option>
	       <option value="内蒙古">内蒙古</option>
	       <option value="江苏">江苏</option>
	       <option value="江西">江西</option>
	       <option value="吉林">吉林</option>
	       <option value="辽宁">辽宁</option>
	       <option value="宁夏">宁夏</option>
	       <option value="青海">青海</option>
	       <option value="山西">山西</option>
	       <option value="山东">山东</option>
	       <option value="上海">上海</option>
	       <option value="四川">四川</option>
	       <option value="天津">天津</option>
	       <option value="西藏">西藏</option>
	       <option value="新疆">新疆</option>
	       <option value="云南">云南</option>
	       <option value="浙江">浙江</option>
	       <option value="陕西">陕西</option>
	       <option value="台湾">台湾</option>
	       <option value="香港">香港</option>
	       <option value="澳门">澳门</option>
	       <option value="海外">海外</option>
	    </select>
	    <select name="zd_city" id="zd_city" style="width: 75px;">
	    	<option value="">选择市</option>
	  	</select>
		<script type="text/javascript">
			$("#zd_province").val("<%=CommonString.getFormatPara(model.get("province")) %>");
			$("#zd_province").change();
			$("#zd_city").val("<%=CommonString.getFormatPara(model.get("city")) %>");
		</script>
    </div>
    <div class="formLeft">详细地址</div>
    <div class="formRight">
      <input type="text" class="jr_text" name="zd_address" id="zd_address" value="<%=CommonString.getFormatPara(model.get("address")) %>" />
    </div>
    <div style="clear:left;"></div>
    <div class="formLeft">邮<span class="span2"></span>编</div>
    <div class="formRight">
      <input type="text" class="jr_text" name="zd_postcode" id="zd_postcode" value="<%=CommonString.getFormatPara(model.get("postcode")) %>" />
    </div>
  
	
	<div style="clear:left;"></div>
    <div class="formLeft">公司名称</div>
    <div class="formRight">
      <input type="text" class="jr_text" name="zd_dealer_company" id="zd_dealer_company" value="<%=CommonString.getFormatPara(model.get("dealer_company")) %>" />
    </div>
    <div class="formLeft">地<span class="span2"></span>址</div>
    <div class="formRight">
      <input type="text" class="jr_text" name="zd_dealer_address" id="zd_dealer_address" value="<%=CommonString.getFormatPara(model.get("dealer_address")) %>" />
    </div>
	
	<div style="clear:left;"></div>
    <div class="formLeft">联系人</div>
    <div class="formRight">
      <input type="text" class="jr_text" name="zd_dealer_people" id="zd_dealer_people" value="<%=CommonString.getFormatPara(model.get("dealer_people")) %>" />
    </div>
    <div class="formLeft">联系方式</div>
    <div class="formRight">
      <input type="text" class="jr_text" name="zd_dealer_contact" id="zd_dealer_contact" value="<%=CommonString.getFormatPara(model.get("dealer_contact")) %>" />
    </div>
	
	
	<div style="clear:left;"></div>
    <div class="formLeft">网<span class="span2"></span>址</div>
    <div class="formRight">
      <input type="text" class="jr_text" name="zd_dealer_web" id="zd_dealer_web" value="<%=CommonString.getFormatPara(model.get("dealer_web")) %>" />
    </div>
    <div class="formLeft">经营产品</div>
    <div class="formRight">
      <input type="text" class="jr_text" name="zd_dealer_pro" id="zd_dealer_pro" value="<%=CommonString.getFormatPara(model.get("dealer_pro")) %>" />
    </div>
	
	
    <div class="group">
		<span><img src="/plugin/ui/ligerUI/ligerUI/skins/icons/communication.gif" /></span>
		<span class="groupTitle">扩展信息（<font color="#ff0000">*</font>为必填项）</span>
	</div>
    <div class="formLeft">状<span class="span2"></span>态</div>
    <div class="formRight"> <%=CommonForm.createRadio(isMap,CommonString.getFormatPara(model.get("state")),"zd_state") %> </div>
    <div style="clear:left;"></div>
    <div class="formLeft">登录次数</div>
    <div class="formRight" style="text-align: left;width:120px">
      <input type="text" class="jr_text" readonly="true" name="zd_login_count" id="zd_login_count" value="<%=CommonString.getFormatPara(model.get("login_count")) %>" />
    </div>
    <div class="formLeft">最后登录时间</div>
    <div class="formRight" style="text-align: left;width:120px">
      <input type="text" class="jr_text"  readonly="true" name="zd_last_login_date" id="zd_last_login_date" value="<%=CommonString.getFormatPara(model.get("last_login_date")) %>" />
    </div>
    <div class="formLeft">最后登录IP</div>
    <div class="formRight" style="text-align: left;width:120px">
      <input type="text" class="jr_text" readonly="true" name="zd_last_login_ip" id="zd_last_login_ip" value="<%=CommonString.getFormatPara(model.get("last_login_ip")) %>" />
    </div>
    <div style="clear:left;"></div>
    <div class="group">
		<span><img src="/plugin/ui/ligerUI/ligerUI/skins/icons/communication.gif" /></span>
		<span class="groupTitle">休闲护照申请信息</span>
	</div>
	<div class="formLeft">身份证（正）</div>
    <div class="formRight" style="width:400px;">
      <input type="text" readonly="readonly" style="width: 400px;float:left;" class="jr_text" name="zd_shenfenzheng_zheng" id="zd_shenfenzheng_zheng" value="<%=CommonString.getFormatPara(model.get("shenfenzheng_zheng")) %>" />
    </div>
      <div class="formRight" style="width: 100px;"><a
              href="http://img.52sdskj.com<%=CommonString.getFormatPara(model.get("shenfenzheng_zheng")) %>"
              id="zheng_img" onclick='return hs.expand(this)'><img src="/backend/images/yulan.gif"/></a> <span
              id="shenfenzheng_zheng_img"></span></div>
    <div style="clear:left;"></div>
    <div class="formLeft">身份证（反）</div>
    <div class="formRight" style="width:400px;">
      <input type="text" readonly="readonly" style="width: 400px;float:left;" class="jr_text" name="zd_shenfenzheng_fan" id="zd_shenfenzheng_fan" value="<%=CommonString.getFormatPara(model.get("shenfenzheng_fan")) %>" />
    </div>
      <div class="formRight" style="width: 100px;"><a
              href="http://img.52sdskj.com<%=CommonString.getFormatPara(model.get("shenfenzheng_fan")) %>" id="fan_img"
              onclick='return hs.expand(this)'><img src="/backend/images/yulan.gif"/></a> <span
              id="shenfenzheng_fan_img"></span></div>
    <div style="clear:left;"></div>
  </div>
  <div style="clear: left;"></div>
  <div class="formLeft">1寸照</div>
    <div class="formRight" style="width:400px;">
      <input type="text" readonly="readonly" style="width: 400px;float:left;" class="jr_text" name="zd_yicun_photo" id="zd_yicun_photo" value="<%=CommonString.getFormatPara(model.get("yicun_photo")) %>" />
    </div>
    <div class="formRight" style="width: 100px;"><a
            href="http://img.52sdskj.com<%=CommonString.getFormatPara(model.get("yicun_photo")) %>" id="yi_img"
            onclick='return hs.expand(this)'><img src="/backend/images/yulan.gif"/></a> <span id="yicun_img"></span>
    </div>
    <div style="clear:left;"></div>
  <div style="clear: left;"></div>
  <input type="hidden" name="tableName" id="tableName" value="<%=tableName %>" />
  <input type="hidden" name="zd_id" id="zd_id" value="<%=CommonString.getFormatPara(model.get("id")) %>" />
  <input type="hidden" name="zd_channel_uuid" id="zd_channel_uuid" value="<%=channelUUID %>" />
</form>
</body>
</html>
<script type="text/javascript" src="/plugin/jquery/jquery.form.js"></script>
<script src="/plugin/ui/ligerUI/ligerUI/js/ligerui.min.js" type="text/javascript"></script>
<script src="/plugin/date/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<script src="/backend/scripts/common.js" prefix="<%=tablePrefix %>" type="text/javascript"></script>
<script src="/plugin/validator/wofoshan/validator.min.js" type="text/javascript"></script>
<script type="text/javascript" src="/plugin/other/highslide/highslide.min.js"></script>
<script type="text/javascript" src="http://img.52sdskj.com/plugin/upload/jr_upload.js"></script>
<script type="text/javascript">
	hs.graphicsDir = '/plugin/other/highslide/graphics/';
	hs.wrapperClassName = 'wide-border';
	jQuery("#shenfenzheng_zheng_img").JrUpload({
        remotUrl: "http://img.52sdskj.com/upload.jsp",
		folder : "saygou/huzhao" ,
		watermark:false,
		callback : "setZhenImg"
	});
	function setZhenImg(data){
		var imgUrl = data;
        jQuery("#zheng_img").attr("href", "http://img.52sdskj.com" + imgUrl);
		jQuery("#zd_shenfenzheng_zheng").val(imgUrl);
	}
	jQuery("#shenfenzheng_fan_img").JrUpload({
        remotUrl: "http://img.52sdskj.com/upload.jsp",
		folder : "saygou/huzhao" ,
		watermark:false,
		callback : "setFanImg"
	});
	function setFanImg(data){
		var imgUrl = data;
        jQuery("#fan_img").attr("href", "http://img.52sdskj.com" + imgUrl);
		jQuery("#zd_shenfenzheng_fan").val(imgUrl);
	}
	
	jQuery("#yicun_img").JrUpload({
        remotUrl: "http://img.52sdskj.com/upload.jsp",
		folder : "saygou/huzhao" ,
		watermark:false,
		callback : "setYicunImg"
	});
	function setYicunImg(data){
		var imgUrl = data;
        jQuery("#yi_img").attr("href", "http://img.52sdskj.com" + imgUrl);
		jQuery("#zd_yicun").val(imgUrl);
	}
	
	
	function checkUserUnique(){
		var mem_no=$.trim($("#zd_mem_no").val());
		if(mem_no==""){
			alert("请输入用户名！");
			return;
		}
		
			$.ajax({
				type:"post",
				url:"/backend/action/ajax_r.jsp",
				data:{enumNo:"106013",flag:"checkUserUnique",mem_no:mem_no},
				success:function(result){
					if($.trim(result)=="0"){
						jrSuccess("恭喜，此用户名尚未使用！");
					}else{
						jrWarn("抱歉，此用户名已存在，请更换！");
					}
				}
			});
	}

	function doSub(){
	}
</script>
<%
	}catch(Exception e){
		e.printStackTrace();
	}finally{
		DBHelper.freeConnection(connection);
	}
%>